/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package javax.servlet;

import java.io.IOException;

/**
 * 一组过滤器对某些web资源进行拦截，那么这组过滤器就称为过滤器链。过滤器的执行顺序和有关（谁在前先执行谁）。
 *
 * FilterChain是servlet容器提供给开发人员的一个对象，它向开发人员提供了对资源的过滤请求的调用链的视图.
 *  过滤器使用过滤器链调用链中的下一个过滤器，或者如果调用过滤器是链中的最后一个过滤器，则调用链末端的资源.
 *
 * A FilterChain is an object provided by the servlet container to the developer
 * giving a view into the invocation chain of a filtered request for a resource. Filters
 * use the FilterChain to invoke the next filter in the chain, or if the calling filter
 * is the last filter in the chain, to invoke the resource at the end of the chain.
 *
 * @see Filter
 * @since Servlet 2.3
 */

public interface FilterChain {
	
	/**
	 * 调用链中的下一个筛选器，或者如果调用筛选器是链中的最后一个筛选器，则会导致调用链末尾的资源.
	 *
	 * Causes the next filter in the chain to be invoked, or if the calling filter is the last filter
	 * in the chain, causes the resource at the end of the chain to be invoked.
	 *
	 * @param request the request to pass along the chain.
	 * @param response the response to pass along the chain.
	 *
	 * @since 2.3
	 */
	
    public void doFilter ( ServletRequest request, ServletResponse response ) throws IOException, ServletException;

}

